import request from '@/utils/request'

const staffApi = {
	// 供应链查询
	getSupplyInfo: (id, deptId) => {
		return request({
			url: `/system/supply-chain/api/getSupplyChainByTenantId?id=${id}&companyType=10&deptId=${deptId}`,
			method: 'GET'
		})
	},
  // 供应链负责人
  getSupplyAdminDetail: () => {
    return request({
      url: '/system/supply-chain/api/getScmAdmin',
      method: 'GET'
    })
  },
	// 供应商查询
	getSupplierInfo: (id) => {
		return request({
			url: `/vms/supplier/get?id=${id}`,
			method: 'GET'
		})
	},
  // 供应商负责人
  getSupplierAdminDetail: (supplierId) => {
    return request({
      url: `/system/supplier/api/getSupplierAdmin?supplierId=${supplierId}`,
      method: 'GET'
    })
  },

	// 供应链员工列表
	getSupplyStaffList: (data) => {
		return request({
			url: `/system/supply-chain/api/getUserList?pageSize=${data.pageSize}&pageNo=${data.pageNo}&deptId=${data.deptId}`,
			method: 'POST'
		})
	},
  // 供应商员工列表
  getSupplierStaffList: (data) => {
  	return request({
  		url: `/vms/supplier-user-info/page?pageSize=${data.pageSize}&pageNo=${data.pageNo}&supplierId=${data.supplierId}`,
  		method: 'GET'
  	})
  },
  
  // 供应链管理人员数量查询
  getSupplyChainUserStatistics: (companyId, deptId) => {
  	return request({
  		url: `/system/supply-chain/api/getSupplyChainUserStatistics`,
  		method: 'GET',
		data: {
			deptId
		}
  	})
  },
  
  // 供应商管理人员数量查询
  getSupplierChainUserStatistics: (data) => {
  	return request({
  		url: `/vms/supplier-user-info/statistics-user-num?supplierId=${data}`,
  		method: 'GET'
  	})
  },
  
  // 新增时  供应链发货地址列表-未绑定查询
  getAddSupplyAddressList: (data) => {
    return request({
      url: `/vms/supplier-deliver-place/simpleListBySupplyChain?supplierChaidId=${data.id}`,
      method: 'GET'
    })
  },
  // 新增时  供应商发货地址列表-未绑定查询
  getAddSupplierAddressList: (data) => {
    return request({
      url: `/vms/supplier-deliver-place/simple-list?supplierId=${data.id}`,
      method: 'GET'
    })
  },
  // 修改时  供应链发货地址列表-查询
  getEditSupplyAddressList: (data) => {
    return request({
      url: `/vms/supplier-deliver-place/pageBySupplyChain?pageNo=${data.pageNo}&pageSize=${data.pageSize}&deliveryPlace=&coverPlace=&supplyChainId=${data.id}`,
      method: 'GET'
    })
  },
  // 修改时  供应商发货地址列表-查询
  getEditSupplierAddressList: (data) => {
    return request({
      url: `/vms/supplier-deliver-place/page?pageNo=${data.pageNo}&pageSize=${data.pageSize}&deliveryPlace=&coverPlace=&supplierId=${data.id}`,
      method: 'GET'
    })
  },
  // 删除供应链员工
  deleteSupplyUser: (data) => {
  	return request({
  		url: `/system/supply-chain/api/deleteUser?id=${data}`,
  		method: 'DELETE',
  	})
  },
  // 删除供应商员工
  deleteSupplierUser: (data) => {
  	return request({
  		url: `/vms/supplier-user-info/delete?id=${data}`,
  		method: 'DELETE',
  	})
  },
  
  // 添加-供应链员工
  addSupplyStaff: (data) => {
  	return request({
      url: '/system/supply-chain/api/addAdminUser',
  		method: 'POST',
      data
  	})
  },
  // 添加-供应商员工
  addSupplierStaff: (data) => {
  	return request({
      url: '/vms/supplier-user-info/create',
  		method: 'POST',
      data
  	})
  },

	// 修改-供应链员工
	updateSupplyStaff: (data) => {
		return request({
			url: '/system/supply-chain/api/updateAdminUser',
			method: 'POST',
			data
		})
	},
	// 修改-供应商员工
	updateSupplierStaff: (data) => {
		return request({
			url: '/vms/supplier-user-info/update',
			method: 'PUT',
			data
		})
	},

	// 查询-供应链人员
	getAdminUserInfo: (id) => {
		return request({
			url: `/system/supply-chain/api/getAdminUserInfo?id=${id}`,
			method: 'GET',
		})
	},
	// 查询-供应商人员
	getSupplierAdminUserInfo: (id) => {
		return request({
			url: `/system/user/getSupplierUserInfo?id=${id}`,
			method: 'GET',
		})
	},

	// 供应链角色列表
	getSupplyRoleList: () => {
		return request({
			url: `/system/supply-chain/api/getSupplyChainRole`,
			method: 'POST'
		})
	},
  	// 供应商角色列表
	getSupplierRoleList: () => {
		return request({
			url: `/system/supply-chain/api/getSupplierRole`,
			method: 'GET'
		})
	},

	// 供应链修改
	editStaff: (data) => {
		return request({
			url: `/system/supply-chain/api/changeAdmin`,
			method: 'PUT',
			data: data
		})
	},
	// 供应商修改
	editsupplier: (data) => {
		return request({
			url: '/vms/supplier/update-admin',
			method: 'PUT',
			data: data
		})
	},
}
export default staffApi